//
//  ViewController.m
//  01-UIViewHomeWork
//
//  Created by QC.L on 16/7/14.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "ViewController.h"
#import "CustomView.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createBackImage];
    // Do any additional setup after loading the view, typically from a nib.
}
- (void)createBackImage {
    UIImageView *imageOfBack = [[UIImageView alloc]initWithFrame:self.view.frame];
    imageOfBack.image = [UIImage imageNamed:@"welcome_2"];
    imageOfBack.alpha = 0.8;
    [self.view addSubview:imageOfBack];
    UIImageView *imageOfLogo = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 150, 200)];
    [self.view addSubview:imageOfLogo];
    imageOfLogo.center = CGPointMake(self.view.frame.size.width / 2, 200);
    imageOfLogo.image = [UIImage imageNamed:@"logo_lagou"];

    CustomView *view = [[CustomView alloc]initWithFrame:CGRectMake(10, 350, self.view.frame.size.width - 20, 120)];
    [self.view addSubview:view];
    //view.backgroundColor = [UIColor whiteColor];
   // view.layer.cornerRadius = 10;
    [self maskToCorner:view RoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight|UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRedius:CGSizeMake(10.0f,10.0f)];
   
    
    UIButton *buttonOfLogin = [UIButton buttonWithType:UIButtonTypeSystem];
    buttonOfLogin.frame = CGRectMake(10, 480, 395, 50);
    [self.view addSubview:buttonOfLogin];
    [buttonOfLogin setTitle:@"登录" forState:UIControlStateNormal];
    buttonOfLogin.backgroundColor = [UIColor colorWithRed:0.00 green:0.67 blue:0.53 alpha:1.00];
    buttonOfLogin.layer.cornerRadius = 10;
    [buttonOfLogin setTitleColor:[UIColor colorWithRed:0.16 green:0.76 blue:0.65 alpha:1.00] forState:UIControlStateNormal];
    buttonOfLogin.titleLabel.font = [UIFont systemFontOfSize:20];
    UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(10, 550, 100, 40)];
    [self.view addSubview:label1];
    label1.text = @"忘记密码";
    label1.textColor = [UIColor  whiteColor];
    UIButton *buttonOf = [UIButton buttonWithType:UIButtonTypeSystem];
    
    [self.view addSubview:buttonOf];
    buttonOf.frame = CGRectMake(0, 0, 150, 40);
    buttonOf.center = CGPointMake(self.view.frame.size.width / 2, 620);
    [buttonOf setTitle:@"现在注册拉勾" forState:UIControlStateNormal];
    [buttonOf setTitleColor:[UIColor colorWithRed:0.09 green:0.62 blue:0.49 alpha:1.00] forState:UIControlStateNormal];
    buttonOf.titleLabel.font = [UIFont systemFontOfSize:20];
    UIView *firstview = [[UIView alloc]initWithFrame:CGRectMake(10, 660, 170, 2)];
    [self.view addSubview:firstview];
    firstview.backgroundColor = [UIColor whiteColor];
    UILabel *labelOfOr = [[UILabel alloc]initWithFrame:CGRectMake(200, 650, 20, 20)];
    [self.view addSubview:labelOfOr];
    labelOfOr.text = @"or";
    labelOfOr.font = [UIFont boldSystemFontOfSize:20];
    labelOfOr.textColor = [UIColor whiteColor];
    UIView *secondview = [[UIView alloc]initWithFrame:CGRectMake(240, 660, 165, 2)];
    [self.view addSubview:secondview];
    secondview.backgroundColor = [UIColor whiteColor];
    UILabel *labelOfLast = [[UILabel alloc]initWithFrame:CGRectMake(170, 680, 100, 30)];
    [self.view addSubview:labelOfLast];
    labelOfLast.text = @"随便逛逛>";
    labelOfLast.textColor = [UIColor whiteColor];
    
}
- (void)maskToCorner:(UIView *)view RoundingCorners:(UIRectCorner)corner cornerRedius:(CGSize)size {
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:corner cornerRadii:size];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init];
    maskLayer.frame = view.bounds;
    maskLayer.path = maskPath.CGPath;
    view.layer.mask = maskLayer;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
